/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package koneksi;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author Prasetyawan
 */
public class koneksi {
    /*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

    public static Connection open (String url, String userId, String password){

       Connection conn=null;

            OracleDataSource ds;
        try {
            ds = new OracleDataSource();
            ds.setURL(url);

            conn = ds.getConnection (userId, password);
            System.out.println("Koneksi OK");

        } catch (SQLException ex) {
            Logger.getLogger(koneksi.class.getName()).log(Level.SEVERE, null, ex);

        }
            return conn;


    }

}


